package com.baogu.factoryjob.manager.impl;

import com.baogu.factoryjob.manager.JobManager;
import com.baogu.factoryjob.mapper.JobManageMapper;
import com.baogu.model.job.JobManage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class JobManagerImpl implements JobManager {

    @Autowired
    JobManageMapper jobManageMapper;


    @Override
    public Integer addJob(JobManage jobManage) {
        return jobManageMapper.insertSelective(jobManage);
    }

    @Override
    public JobManage getJobById(String jobId) {
        return jobManageMapper.selectByPrimaryKey(jobId);
    }

    @Override
    public Integer deleteJob(String jobId) {
        return jobManageMapper.deleteByPrimaryKey(jobId);
    }

    @Override
    public Integer updateJob(JobManage jobManage) {
        return jobManageMapper.updateByPrimaryKeySelective(jobManage);
    }

    @Override
    public List<JobManage> getJobList(JobManage jobManage) {
        return jobManageMapper.allList(jobManage);
    }
}
